package main

import "fmt"

func main() {

	var num = 18
	var pr *int = &num
	fmt.Println(&num)
	fmt.Println(pr)  //pr为指针类型，获取到的是num的内存地址
	fmt.Println(&pr) //获取到pr的内存地址
	fmt.Println(*pr) //获取到pr本身内存地址值对应的数据

	//练习用户输入 外加if条件判断
	//var count int = 70
	//var count2 int
	//fmt.Println("请输入count2的值:")
	//fmt.Scanln(&count2)
	//if count := 70; count < count2 {
	//	fmt.Println(count < count2)
	//} else {
	//	fmt.Println("啦啦啦啦")
	//}
	switch b := 10; {
	case b > 9:
		fmt.Println("....")
	case b > 12:
		fmt.Println("///////")
	}

	var name = "sncjdnghdmdfkg"
	for i := 0; i < len(name); i++ {
		fmt.Printf("%c", name[i])
		fmt.Println()
	}

	for i, j := range name {
		fmt.Printf("索引是%v,直是%c", i, j)
		fmt.Println()
	}
}
